//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "UI/Resources/UIFrameResource.h"
#include "UI/Resources/UILocaleResource.h"
#include "UI/Resources/UILocaleSettingsResource.h"

namespace Engine
{
namespace UI
{

	//
	// UI Loader
	//

	struct UILoader
	{
	// methods
	public:
		UILoader ();
		
		void Register (ResourceManager *rm);
		void Unregister (ResourceManager *rm);

		static bool LoadFrame (ResourcePtr &resource, const RFilePtr &file, void *parameter,
								const Resource::ResLoadParams &loadParams, const EngineSubSystemsRef ess);
		
		static bool LoadLocale (ResourcePtr &resource, const RFilePtr &file, void *parameter,
								const Resource::ResLoadParams &loadParams, const EngineSubSystemsRef ess);
		
		static bool LoadLSettings (ResourcePtr &resource, const RFilePtr &file, void *parameter,
									const Resource::ResLoadParams &loadParams, const EngineSubSystemsRef ess);

	private:
		static bool _LoadFrame (ResourcePtr &resource, const RFilePtr &file, void *parameter,
								 const UIFrameResource::UIFrameLoadParams &loadParams, const EngineSubSystemsRef ess);
		
		static bool _LoadLocale (ResourcePtr &resource, const RFilePtr &file, void *parameter,
								 const UILocaleResource::UILocaleLoadParams &loadParams, const EngineSubSystemsRef ess);
		
		static bool _LoadLSettings (ResourcePtr &resource, const RFilePtr &file, void *parameter,
									const UILocaleSettingsResource::UILSettingsLoadParams &loadParams, const EngineSubSystemsRef ess);
	};


}	// UI
}	// Engine
